Never initialized r in binToInt, potential bug fix.