implemented largestSequence