Changed the conditionals for handling the first day of the month