scala naturalsort algorithm