Lots of cleanup. Lost some formatting, will fix next.