more generic ecart_max