added docstrings
some other changes
merging