added some cache for speeding up ourIndex