REF: Changed so that an overall algorithm controls node, easier implementation of global maximums etc