major modification on mining project (endianness problem  on SPI)