Added multiple ~ signs where needed in my &= statements.