added day_of_week() function to trim down code