Added code to insert readings into table