Added search of min and max