initial PEP8 compliant & login/logout bug fix