Upgrade double-ended qst2 algorithm