cleaned up code a bit, login now works