Implemented Vitterbi Algorithm