bugfix in nsort, now a regular function