Revised rate matching algorythm