Changed arrays to hashes