updated some more toAst functions