updated move function to act upon the availability of next position