Make the code more efficient. Deleted second reading, due to the iterator in Hash.