add full functionality of login, currently no bugs