k-GNN function fixed