--added mode intelligent code to the next 7 days logic--