contains with recursion