Final working version of AST