implements basic search functionality