initial calculateProbabilities work
fix merge
fix (forgotten part of) merge
misc fixes to probability code