Variable length Markov chains