Added some comments for the code