fixed imports and pep8 conformity and use constant for degree symbol.
code refactoring