updated constructAst such that if - else stmts work