Draft implementation of BaumWelch