add encoding of binary arrays