fixed a bug caused by bad transition matrix initialization