lots more tweaks and formatting