Implemented the shunting yard algorithm