Tested and optimized IndexedMap