Ah, I see what you are doing now, each position in the row can be occupied by one of 16 bells = 2^4 so you need 4 bits to hold the bell number for each place in the row, and the masks therefore need to be 4 bits as well. Neat :-) -- Alan Burlison --