Talk:Kleitman–Wang algorithms

It looks to me like these algorithms are stated wrongly. I think b_i and b_{b_i} are being confused. Or am I missing something?