Added math for date extraction