moving to locals; fixing _ast vs ast, adding tests