added code to find date range