modified to make it working with cascading unifier