reorder the equations