cleaned up log in and user state stuff. Fixed location issues