implementing an expression tree to solve prefix expressions