Added functions newNode, lengthIter, lengthRecur.