Add comments to NMS code