lots of little tweaks and formatting fixes