Add comments. Changed some things to be PEP8 compliant. Improved general readibility (still more to do).