added spi testing code