adding in the unit generator code