finish the first prototype of the diagram class