Added some comments in the code