added statistics taking