further work fixing the unifier (still not completely correct)