set max ress and min