Changing structure and complyingf code to PEP8.