Implement nth functionality

Closes issue #6