implement deltaSequence algorithm