cleaned up code some, completed log in