rewritten getProbabilityFrom to improve it