modified to extract the max of the probs
from prep=for to prep=None