Fixed generator.
Proper HMM structure, increased precision of calculations.