Rewrote overly complicated itemregionstat code