Improvements

PEP8, better performance