Implementation of a simple algebraic calculator