Added changes to getProbability Method