add the pssibility to search minima and maxima