added SPI stuff so that the program can communicate through SPI instead of through serial