implement prefix and postfix transformation