some corrections incorporated, including PEP8