basic search function implemented