correction of maximalization algorithm