added statistics logging