Removing some substring messing-about from my Markov model