add and use range model
correctly deal with the range model