cleaned up code/modified login process