First version of login functionality