Revised calcIndex, keyExists, and find.