public void EndCalibratedGesture()
    {
        if (!calibrating || (lNextSample == -1 && rNextSample == -1))
        {
            return;
        }

        lNextSample = -1;
        rNextSample = -1;

        calibrating = false;

        Gesture.GestureHand hands = currentGesture.GetCurHands();

        //If there's only 1 node in one of the hands just delete the gesture and stop cause otherwise bad things happen during conversion
        if ((hands == Gesture.GestureHand.LEFT && currentGesture.NumNodes(Gesture.GestureHand.LEFT) < 2) ||
            (hands == Gesture.GestureHand.RIGHT && currentGesture.NumNodes(Gesture.GestureHand.RIGHT) < 2) ||
            (hands == Gesture.GestureHand.BOTH && (currentGesture.NumNodes(Gesture.GestureHand.LEFT) < 2 || currentGesture.NumNodes(Gesture.GestureHand.RIGHT) < 2)))
        {
            currentGesture = null;
            return;
        }

        currentGesture.ChangeNumNodes(samplesPerGesture);
        currentGesture.DuplicateHand();

        if (calibratedGestures.Count == numCalibrations - 1)
        {
            Debug.Log("Finishing gesture");

            //Average the gestures
            for (int i = 1; i < samplesPerGesture; i++)
            {
                Vector3 avgNode   = currentGesture.NodeAt(i, Gesture.GestureHand.LEFT);
                float   avgLength = avgNode.magnitude;

                for (int j = 0; j < calibratedGestures.Count; j++)
                {
                    Vector3 node = calibratedGestures[j].NodeAt(i, Gesture.GestureHand.LEFT);

                    avgNode   += node;
                    avgLength += node.magnitude;
                }

                avgNode   /= numCalibrations;
                avgLength /= numCalibrations;

                avgNode = avgNode.normalized * avgLength;

                currentGesture.SetNodeAt(i, Gesture.GestureHand.LEFT, avgNode);
            }

            //Save the gesture to the json
            switch (calibrationType)
            {
            case SpellHandler.SpellType.ONE_QUICK:
            case SpellHandler.SpellType.ONE_HEAVY:
            case SpellHandler.SpellType.ONE_SPECIAL:
                SaveLastGesture(calibrationType, false);
                break;

            case SpellHandler.SpellType.TWO_DEFENSE:
            case SpellHandler.SpellType.TWO_OFFENSE:
                SaveLastGesture(calibrationType, true);
                break;
            }

            //Clear the gestures
            calibratedGestures = new List <Gesture>();

            calibrationMenu.FinishedGesture();
        }
        else
        {
            Debug.Log("Ending gesture");

            //Add the gesture so it can be used once enough are recorded
            calibratedGestures.Add(currentGesture);

            calibrationMenu.DecreaseRemainingGestures();
        }
    }