docs: function (lists, theta, order, conn, aBoolean, otherElId, idx, reverse, edgeId, elId, connsToPaint, endpointsToPaint) {
              // first try to find the exact match, but keep track of the first index of a matching element id along the way.s
              var exactIdx = -1,
                  firstMatchingElIdx = -1,
                  endpoint = conn.endpoints[idx],
                  endpointId = endpoint.id,
                  oIdx = [1, 0][idx],
                  values = [
                      [ theta, order ],
                      conn,
                      aBoolean,
                      otherElId,
                      endpointId
                  ],
                  listToAddTo = lists[edgeId],
                  listToRemoveFrom = endpoint._continuousAnchorEdge ? lists[endpoint._continuousAnchorEdge] : null,
                  i,
                  candidate;
  
              if (listToRemoveFrom) {
                  var rIdx = _ju.findWithFunction(listToRemoveFrom, function (e) {
                      return e[4] == endpointId;
                  });
                  if (rIdx != -1) {
                      listToRemoveFrom.splice(rIdx, 1);
                      // get all connections from this list
                      for (i = 0; i < listToRemoveFrom.length; i++) {
                          candidate = listToRemoveFrom[i][1];
                          _ju.addWithFunction(connsToPaint, candidate, function (c) {
                              return c.id == candidate.id;
                          });
                          _ju.addWithFunction(endpointsToPaint, listToRemoveFrom[i][1].endpoints[idx], function (e) {
                              return e.id == candidate.endpoints[idx].id;
                          });
                          _ju.addWithFunction(endpointsToPaint, listToRemoveFrom[i][1].endpoints[oIdx], function (e) {
                              return e.id == candidate.endpoints[oIdx].id;
                          });
                      }
                  }
              }
  
              for (i = 0; i < listToAddTo.length; i++) {
                  candidate = listToAddTo[i][1];
                  if (params.idx == 1 && listToAddTo[i][3] === otherElId && firstMatchingElIdx == -1)
                      firstMatchingElIdx = i;
                  _ju.addWithFunction(connsToPaint, candidate, function (c) {
                      return c.id == candidate.id;
                  });
                  _ju.addWithFunction(endpointsToPaint, listToAddTo[i][1].endpoints[idx], function (e) {
                      return e.id == candidate.endpoints[idx].id;
                  });
                  _ju.addWithFunction(endpointsToPaint, listToAddTo[i][1].endpoints[oIdx], function (e) {
                      return e.id == candidate.endpoints[oIdx].id;
                  });
              }
              if (exactIdx != -1) {
                  listToAddTo[exactIdx] = values;
              }
              else {
                  var insertIdx = reverse ? firstMatchingElIdx != -1 ? firstMatchingElIdx : 0 : listToAddTo.length; // of course we will get this from having looked through the array shortly.
                  listToAddTo.splice(insertIdx, 0, values);
              }
  
              // store this for next time.
              endpoint._continuousAnchorEdge = edgeId;
          }