Added some comments to help understand the code