npudistbw now uses trees when possible