Added some comments to clarify the code