implented basic search function