fei's solution with the new hmms