Rewrote PlotKNNPF: vectorized