Fixed shunting-yard algorithm

Previous reverse polish notation conversion was incorrect