A device is provided for use in the alignment of sheets transverse to a direction of sheet travel. The loop instructions are selectively executed based on their stage numbers, thereby eliminating the need for explicit loop set-up and tear-down instructions. Means are provided for moving the valve element in the recess such that the first portion provides continuous fluid communication between the inlet passage and one of the exit openings during movement of the valve element and the second portion provides intermittent fluid communication between the inlet passage and another of the exit openings during movement of the valve element.