hierarchy adjusted to handle bigger datasets.