implemented localMaxima