Made the code more PEP-8. Added descriptive comments and TODO's.