Renamed contigLength to maxIndex