added inverse probability script