major overhaul to generate code
generator is now in working order, just need a few more tweaks