First working version of login system