improve infix-to-prefix conversion