The next two lines could be condensed down to the single line:
```
look_ahead = @frames[@nxt, 2]
```
This would also allow the ```look_ahead = []``` on line 50 to be removed.