Allow array and hash values in order and merge duplicate values