Made the findAd() method smarter