moved certainty factor function to mainscreen