how to speed up filtering of dn's