Added some code for CTMC