Clean up mini-hmm
Add code to calculate backward matrix (not well tested)