macro expansion code and lots of small tweaks to accomodate it / make code more habitable ; still testing