Revised keyExists to reflect changes to calcIndex.