General code cleanup

added multiple docstrings
General code cleanup