most initial AST work done; fix bug