public SinglyLinkedListNode<T> deleteNode(int index) {
    // Check for out of bounds insertion.
    if (index > size) {
      return null;
    }

    SinglyLinkedListNode<T> deleteNode = null;
    SinglyLinkedListNode<T> newNextNode = null;

    // Find the node before the node we want to delete.
    SinglyLinkedListNode<T> current = start;
    for (int i = 0; i < index - 1; i++) {
      current = current.getNextNode(); 
    }

    // Deal with special cases.
    if (size == 1) {
      deleteNode = current;
    } else if (index == 0) {
      deleteNode = current;
    } else if (index == size) {
      deleteNode = current.getNextNode();
    } else {
      deleteNode = current.getNextNode();
      newNextNode = current.getNextNode().getNextNode();
      current.setNextNode(newNextNode); 
    }

    size--;
    return deleteNode;
  }