got rid of extra function generations.  still running slow.  the only hope of speeding this up is adding simplifications for trig identities