added t helper sub: nsort