Sort library detection