fixes the order of the instructions