added endian control