Fixed overflow by keeping track of the lowest max as we recursed.