   return crc;
 }
 
+//prints all rtcData, including the leading crc32
 void printMemory() {
   char buf[3];
+  uint8_t *ptr = (uint8_t *)&rtcData;
   for (int i = 0; i < sizeof(rtcData); i++) {
-    sprintf(buf, "%02X", rtcData.data[i]);
+    sprintf(buf, "%02X", ptr[i]);
     Serial.print(buf);
     if ((i + 1) % 32 == 0) {
       Serial.println();

    Serial.println("Read: ");
    printMemory();
    Serial.println();
    uint32_t crcOfData = calculateCRC32(((uint8_t*) &rtcData) + 4, sizeof(rtcData) - 4);
    Serial.print("CRC32 of data: ");
    Serial.println(crcOfData, HEX);
    Serial.print("CRC32 read from RTC: ");

  }

  // Generate new data set for the struct
  for (int i = 0; i < sizeof(rtcData.data); i++) {
    rtcData.data[i] = random(0, 128);
  }
  // Update CRC32 of data
  rtcData.crc32 = calculateCRC32( (uint8_t*) &rtcData.data[0], sizeof(rtcData.data) );
  // Write struct to RTC memory
  if (ESP.rtcUserMemoryWrite(0, (uint32_t*) &rtcData, sizeof(rtcData))) {
    Serial.println("Write: ");
