Actually, looking by the code, I think you got multipliers wrong ;)
divisor for belts should be 40/3 and multipliers 1,.5,1/3 instead of 3
for yellow: x1/(40/3) which is equivalent to x3/40 (so it's ok)
for red: x.5/(40/3) which is equivalent to x3/80
for blue: x(1/3)/(40/3) which is equivalent to x1/40 (so it's ok)