Variable length markov chains