add rotation and directional movement to example code