Added a comment explaining calcIndex return value.