Adding probability function