Small extra stuffs. PS.getDistinctChunks and reverseIndex of map.