added basic datalogging