change the order of solving equation