Update task2. Replace array to a hash