added the option to read the probabilities from the file