How to solve algebraic expressions in small steps