simplifying some code in the `nth` function