Naive BM goes quadratic at
T: aaaaaaaaaaaa
P: xaaaaa
Not easy to come up with an improvement, there will always be that exception you didn't think of XD
I wonder, if you could derive meta information about the DNA "lyrical" composition by observing the BM put through. After all the algorithm assumes random text.