enhanced smooth movement, improved logic, and added arbitrary rotations