Implement BaumWelch