Made the searchFunction work. Yaaay.