                     "timetostart": time,
                     "profilename": profilename,
                 ]
-                self.expandedData.append(dictSchedule)
+                self.expandedData!.append(dictSchedule)
             }
         }
     }

                    break
                }
            }
            self.sortedschedules = self.expandedData.sorted { (di1, di2) -> Bool in
                if (di1.value(forKey: "start") as? Date)!.timeIntervalSince((di2.value(forKey: "start") as? Date)!) > 0 {
                    return false
                } else {

class ScheduleSortedAndExpand: SetConfigurations, SetSchedules {
    private var schedulesNSDictionary: [NSDictionary]?
    private var scheduleConfiguration: [ConfigurationSchedule]?
    private var expandedData: [NSDictionary]?
    private var sortedschedules: [NSDictionary]?

    // Calculate daily schedules
