added more comments to code body