linear search with generics