add comparison code for hashmap and array