implement linear search in helpers.c