Refactored old demo code. enjoy 100k+ rects ;)