I need to speed up the nested loop below. Scores linked to item IDs are recorded by date. For each item with multiple scores, I need to relate the scores and the time distance b