some docstrings added and other minor fixes