objectives.copyInto(objectivesArray);
if (objectivesCount > 0) dealWithSavingObjectives(objectivesCount, objectivesArray);
objectives.clear();
// update the interactions
String[][] interactionsArray = new String[interactions.size()][2];
interactions.copyInto(interactionsArray);
if (interactionsCount > 0) dealWithSavingInteractions(interactionsCount, interactionsArray);
interactions.clear();
// finally commit this back to disk
try {
saveDocument();