Importance sampling using the code from the cw