rewritten parser, if-statement