starting to port NewDiagram()