first version of index using P_t_multithread