rewrite (kernel density approach)