added some function to convert to AST