update to use log probabilities