use gsort instead of sort for testing