made endianness checking code