public void addToPosition (int position) { Node anotherNode = new Node (currentDataValue); Node temp; Node current; int index; if ((position < 1) || (position > (length+1))) { System.out.println("Position must be a value between 1-" + (length+1)); } else { if (isEmpty() == true) { if (position == 1) { length++; head = anotherNode; } else System.out.println("List empty"); } else if (position == 1) { anotherNode.next = head; head = anotherNode; } else { current = head; index = 1; while (index < (position-1)) { current = current.next; index++; } anotherNode.next = current.next; current.next = anotherNode; length++; } } }