Cleanup the iic_write function