using ~= operator to enhance arrays pattern matching