Reformatted code to fix editor inconsistencies, and bring it up to PEP 8