IK function

adding inverse kinematics