modified hsmm_sim to prepare to run on server