completely rewrote the rendering cycle