Leap motion using two hands to move character

Concept is to use leap motion, when both hands are stretched out, the character is moving forward and when both hand retrieve backward, the character will move backwards. the direction of the movement is depending on the both hand pointing direction.

the leapMoving.cs script is created as follows and attached to the first person controller in the unity.

using UnityEngine;
using System.Collections;
using Leap;

public class LeapMoving : MonoBehaviour {

    public CharacterController player;
     float speedfactor = -0.001f;

    // Use this for initialization
    void Start () {

    }

    // Update is called once per frame
    void FixedUpdate () {

        Controller controller = new Controller ();

        Frame frame = controller.Frame (); // controller is a Controller object
        HandList hands = frame.Hands;
        Hand firstHand = hands [0];
        Hand secondHand = hands [1];

        float pitch = firstHand.Direction.Pitch;
        float yaw = firstHand.Direction.Yaw;
        float roll = firstHand.PalmNormal.Roll;

        //Debug.Log ("the first hand pitch is: " + pitch);
        //Debug.Log ("the first hand yaw is: " + yaw);
        //Debug.Log ("the first hand roll is: " + roll);

        float pitch2 = secondHand.Direction.Pitch;
        float yaw2 = secondHand.Direction.Yaw;
        float roll2 = secondHand.PalmNormal.Roll;

        //Debug.Log ("the second hand pitch is: " + pitch2);
        //Debug.Log ("the second hand yaw is: " + yaw2);
        //Debug.Log ("the second hand roll is: " + roll2);

        if((firstHand.IsValid) && (secondHand.IsValid)){

            Vector firsthandCenter = firstHand.PalmPosition;
            Vector secondhandCenter = secondHand.PalmPosition;

            Vector firsthandDirection = firstHand.Direction;
            Vector secondhandDirection = secondHand.Direction;

            Vector averageDir = (firsthandDirection + secondhandDirection)/2;
            float averagePitch = (pitch + pitch2) / 2;
            Vector averageCtr = (firsthandCenter + secondhandCenter)/2;

            //Debug.Log ("average center is " + averageCtr.z);

            if(( averageCtr.z < 0 ) || (averageCtr.z > 30)){
                                //converting the averaged both hands direction vector from leap motion to unity
                Vector3 movement = averageDir.ToUnity(false);
//ensure the direction is converted to the local instead of the world               
Vector3 direction = transform.InverseTransformDirection(-movement);
// controls the player movement by the direction vector together with the averaged stretched distance.
                player.Move(direction*(float)averageCtr.z*speedfactor);

            } 

        }

    }

}