private void nearestNeighbours_(KDTreeNode node, Point queryPoint, int depth, KDNeighbours bestNeighbours) {
        if(node == null)
            return;
        if(node.isLeaf()) {
            bestNeighbours.add(node.location);
            return;
        }
        int axis = depth % (queryPoint.coordinates.length);
        KDTreeNode nearSubtree = node.rightChild;
        KDTreeNode farSubtree  = node.leftChild;
        if(queryPoint.coordinates[axis] <= node.location.coordinates[axis]) {
            nearSubtree = node.leftChild;
            farSubtree = node.rightChild;
        }
        nearestNeighbours_(nearSubtree, queryPoint,  depth+1, bestNeighbours);
        if(node.location != queryPoint) 
            bestNeighbours.add(node.location);       
     //   if(Math.pow(node.location.points[axis] - queryPoint.points[axis],2) <= bestNeighbours.largestDistance) 
            nearestNeighbours_(farSubtree, queryPoint, depth+1,bestNeighbours);
        
        return;
    }