updated search logic. not functional yet