working on the sequence...
algorithm works