added twos complement decoding