Reformatted a lot of the code re:PEP8. Functionally the same.