sort the array before testing it