Added some comments next to the code