Added search for maximal pairs right/left