Added the login function.