cleaning up documentation and style for easy editing later
tentatively done cleaning this up. need to test more, of course.