restructuring code, add formulas for offline computation
number of observation symbols (M) is not equal to the sequence length (L)