began implementing data logging. having problems writing the data.