add selectMaxSequence