Lots of cleanup. Mostly working.