corrected for smooth movement