changed to loock though all nodes after max value and added test-case