chapter4 TODO
minor tweak
minor tweak
minor tweak
minor tweak
refactorize viterbi
rename functions
rename functions
rename functions