first version of aggregators using kd trees for finding neighbors