Solution to the sequence transformation problem.

Scores 100 now but is still slow and could be optimized.
Optimization to the sequence transformation problem.