Shunting yard algorithm works for basic functions! Holy God, was this a bitch.