implemented basic search function