now with importance sampling (but unsure if it's worth using or not)