only use unique number of keys in emission matrix