Added user logout functionality and some comments