It may be cleaner to make use of enumerate() here instead of managing 'n' ourselves, as in:
```
for n, record in enumerate(reader, 1):
```