change arrays to hashes