general clean-up of comments, etc.  file formatting in the file-handling functions now works-ish