correct postfixAndInfix function