Update of documentation

Created documentation in rst and added more docstrings in code.