Refactored codes.
Applied PEP8.