add functions for creating HMM