determineNodes algorithm update