reworked much of the logic so that day scans are distinct