IMPLEMENTATION OF NUMERICALLY STABLE HIDDEN MARKOV MODEL