code reformatted according to PEP8 and PEP257