added prediction routines using markov chains