      * TODO: return nil ^ or just remove the days that are malformed?
      */
     static func fromFirebaseValue(_ hoursDict: [String : [[String]]]) -> OpenHours? {
-        var out = [DayOfWeek : [OpenTime]]()
+        var out = [DayOfWeek : [OpenPeriodDateComponents]]()
 
         // Note: we don't check if a day is missing because if it is,
         // it's closed for the day and we're supposed to omit it anyway.
         for dayFromServer in hoursDict.keys {
-            var hoursForDay = [OpenTime]()
             guard let day = DayOfWeek(rawValue: dayFromServer) else {
                 print("lol unknown day of week from server: \(dayFromServer)")
                 return nil
             }
 
             let hoursArr = hoursDict[dayFromServer]! // force unwrap: we're iterating over the keys.
-            hoursArr.forEach { interval in
+            let hoursForDay: [OpenPeriodDateComponents] = hoursArr.flatMap { interval in
                 guard interval.count == 2 else {
                     print("lol last opening interval unexpectedly has \(interval.count) entries")
-                    return
+                    return nil
                 }
 
                 guard let openTime = getTimeComponents(fromServerStr: interval[0]),
                         let closeTime = getTimeComponents(fromServerStr: interval[1]) else {
                     print("lol unable to convert date str, \(interval[0]) & \(interval[1]), to Date")
-                    return
+                    return nil
                 }
-                hoursForDay.append((openTime: openTime, closeTime: closeTime))
+                return(openTime: openTime, closeTime: closeTime)
             }
             out[day] = hoursForDay
         }

    }
}

typealias OpenTime = (openTime: DateComponents, closeTime: DateComponents)
typealias OpenPeriod = (openTime: Date, closeTime: Date)

struct OpenHours {


        return nextOpenPeriod
    }

    private func getEarliestOpeningPeriod(fromOpeningPeriods periods: [OpenPeriodDates]) -> OpenPeriodDates? {
        return periods.first
    }

