tightened up the rendering functions