GenerateMarkovChain updated with implementation