replaced inverted index with sortedmap, sortedset