partial solution to 1's complement