added a function that calculates probabilites, lower and higher