End of day 1 code. parenthesis support added.