initial code for determining probabilities