added prelim SPI code