I'd suggest a comment above these lines, talking about what we're looking for and why we only look at the first/last slots on the page.