Overlap function fixed