created upper limits on the time windows and added a flattening function to the 15 minutes before a window is put in place