nth returns a function to get the nth item