use modulus of 256 not writeInt8