PIM-2240: Add comments to explain code