corrected the velocity and dist. calculation for rotation.