//Update hands
    void UpdateHands()
    {
        if (!frame.Hands.IsEmpty)
        {
            foreach (Leap.Hand hand in frame.Hands)
            {
                //If the hand is not in the list, add it to the list
                bool checkHand = false;
                int  handIndex = -1;
                foreach (LeapHand leapHand in handList)
                {
                    if (leapHand.getHand().Id == hand.Id)
                    {
                        checkHand = true;
                        handIndex = handList.IndexOf(leapHand);
                        break;
                    }
                }

                //Check whether it is a new hand
                if (!checkHand)
                {
                    //A new hand
                    LeapHand newHand = new LeapHand(hand);
                    handList.Add(newHand);
                }
                else
                {
                    //An existing hand
                    handList [handIndex].UpdateHand(hand);
                }
            }

            //Check if there is any hand that should be removed
            for (int i = handList.Count - 1; i >= 0; --i)
            {
                LeapHand leapHand = handList [i];

                bool handInclude = false;
                foreach (Hand hand in frame.Hands)
                {
                    if (leapHand.getHand().Id == hand.Id)
                    {
                        handInclude = true;
                        break;
                    }
                }

                //Remove the hand
                if (handInclude == false)
                {
                    DestroyHandComponents(leapHand);
                    handList.Remove(leapHand);
                }
            }
        }
        else
        {
            //Remove all the hands
            foreach (LeapHand leapHand in handList)
            {
                DestroyHandComponents(leapHand);
            }
            handList.Clear();
        }
    }