added comments and docstrings for some files