Refactored the daily column generation (only one loop)