updated triangle_end()