Added nth function.