first proper implementation of IK