added some statistics functions