refactor compute_probabilities!