Jconnor get units as generator

new get_units as a generator, please review carefully