statistics logging. not finished