added loop diagramer