update function nearly complete, will add randomness later
all nodes are in