Started on processSearch function