added docstings; pep8 changes