prvious fix + General DTMC model
refactor for general model