completed search logic and highlighting functionality