implemented linear search