fixed case when left and rightmax were equal