found and fixed the unification error (S was not being incremented in unify_value evaluation