Trying to calculate state probabilities