added tail mode and begin and end date support