working equivalence of types (not yet finished)