ensuring all elements are unique before appending them to the array; inspecting elements to make it easier to bug fix