Added comments to code
made pep8 changes