move-right and move-left functionality