Updated probability matrix function