created register and login functions