added importance sampling