The very last one in `nextUp` should be just `xi`. The one in the loop can be `return xi`.