added comments to give additional context to logical checks in arithmetic functions