Implementation of the Baum-Welch Algorithm for HMM