Loop diagram

Here is a small diagram that illustrates how the main loop works: