made print function print an actual tree
parentheses work, and added transform function to take care of associativity