Don't Repeat Yourself; make a loop here and build the rects using i * self.panelWidth.