changed arrays to hashes