Implemented imptce sampling (code to be checked)