revised the function that calculates how many new nodes to launch