implemented data logging