More changes to main algorithm and node classes