Nontested, but working version of AST