Fixed flipping and setting bits. within the mutate function