Removed unused imports and did some minor pep8 cleanup.