modified code to work with new HSMM model
first version of HSMM spectral method based on Ankur's paper