Fixed PEP8 whitespace, re-factored to match semantics.