modified solver, to return steps of computation
changed two tests to check if eqn solved in the correct sequence