fix a bug in Structure. finished Diagram.hs