update code for probability mapping