fixing style to match PEP8 and some minor fixes