Add utilities to flip a binary number and to flip codes