PEP8 and typo fixes
Fixed division error and removed boilerplate code