M-Muzafarov: Speed up and PEP8
Merge pull request #3 from m-muzafarov/master

PEP8, clean code and little speed-up.