You can probably do as well:

```
length = corr_last - corr_first + 1
if corr_first >= 0 and length > 0 do
```