use arrays and map to hash