added SD card logging code