add code to compute some statistics