replaced the vectors of vectors by vectors of indices to a continuous memory, using binary search to get to an index.