fixed borked shunting yard implementation