The NBA is getting smarter.