Add nth function.