Tests pass for calcIndex