Added some comments to clarify code