I posted that a long time ago. Only long after I learned the close relationship between bins, k-NN and kernel density.