Remove createArray method, replace with Map.Entry iteration