X-Bar: corrected inverse kinematics function