Simplified the implementation of i2c. Added some comments to the i2c implementation.