Added a few comments

Added some comments to clarify the loops