Added Next Last function from Steve Losh

https://gist.github.com/sjl/3762227