added feature for validating arrays regardless of the order of the elements