z-overlap function