added ratebased alogic.
merge