rewrite drawing a triangle