Cleaned code with pep8 conventions