Fix query to find distances where the person has voted more than once
Extract logic from view