endian conversion C code added