changed array into hashes