Part2 Implementation
Viterbi implementation