Add comments and PEP8 plus some small tweaks