rewrote polygon rendering