converts from infix to postfix for evaluation