The while loop is treating the `current` and `next` variables in the opposite way. Once this is fixed, the while loop should check for `next`, not `current`.