Almost finished the PEP and fixed formatting.