added extended docstring & minor changes