Relative maxima and minima