set min and max