Main changed to local printAST; minor bugs fixed