Fixed taining-day implementation