Added nth function tests

Added nth function tests