almost works, still some problem creating the backwards markov, and does not store the db