fix updateMotion method to properly account for elapsed time