if you have tons of locations this dict could get rather big in memory, though guessing even with 5k is not an issue. if we notice problems can refactor to do it in the other loop