replaced arrays with hashes