implemented spi methods