modified to handle different days.