Implemented shift_left_moving() and shift_right_moving() functions