An efficient algorithm to find the best state sequence in HSMM