add code to read and average ERG