An improved Bayes map algorithm