implement array_contains function