fixed login issues
removed unused code and made PEP8