added recursive method for finding nth node