scaling returned for semi-markov; unused variables removed from encode and context; beta function checked; started writing semi-markov score