code for HMM included in set.initial; made changes elsewhere to
accomodate it. also changes for js to force accumulate