added comments to visually partition the code