stats now uses database; added a couple more statistics