completes unit tests and fixes markov chains