big stuff

whole bunch of changes, first attempt to merge