First version of the code. Still need to write all the cases in multi.prob
Fixing bugs in probabilities calculation