My function works fine 95% of the time, but in some cases it counts of iteration too much or one too low. It has to count up how many times different sequences(dnaTypes) appear