local minima and maxima commands added with static buffer, implementation with arbitrary buffer will be along later