Check the Login: add comments

Added comments to make the code easier to follow