you need an:

```python
else:
    break
```

after this to go with the `if line.startswith('##'):` if block so that it doesn't loop through the whole file. The '##' tags should have to be the first things in the file.