Added sign-in/sign-out functionality (CHAPTER 8)