Added comments and docstrings addressing roberts comments