beautyfying code
add and beautify documentation to SPI module