updated quality algorithm to include next day too