working with hash and array
now uses hashes not arrays