Made the distance queries weighted on population