update I2C code