get unification working with functions