updated comments and docstrings
removed unused code