Changed "<" to "<=" in validate, so equal numbers does not stop the loop.

if (current < next) return; this stops the loop even if the to numbers are the same, changed to:
if (current <= next) return;