refactored moveOn function a bit