simplifying some code in the `nth` function
Merge branch 'master' into extend