added calibrate and statistics routines