sort ends