if (ret == max) this will prevent the test from being done on subsequent parts