a whole bunch of changes and improvements. I let this go too long without commiting