created logic for ratemaster