first draft of markov generateNext with filters and simple backoff logic