solved "one's complement" issues

see comments