fixing ordering of instructions for simulation script