some probability helper functions added