moving min and max are generated