fix the triangle renderer to work
add various other improvements