fixed region file processing, added comments and docstrings
added more comments and docstrings
added some structural comments
module docstring, initial comment, more structure updates