move contains and arraysEqual to global scope