updated importance sampling for diff