Attempt to remove while loop, add nth func.