Turned StatsItem into a tree for calculating depth and retaining parent