Merged Adrian's I2C code with my code