multiple importance sampling, code clean