Added some comments into the code