Code cleanup and added docstrings
Merge remote-tracking branch 'origin/master'