exercise 19: painting of triangles added