tested and fixed parser, updated handling of declarations and if statements