Added some comments in the code for easy navigation