Resolving path problem and making code pep8 compilant