pass minElements and maxElements