encode/manipulate arrays of bits