Update formatting and syntax for better PEP 8 compliance