formatted to pep8 and added doc