Merged with local and some PEP-8 corrections