add some statistics to help with debugging