question about 'sort' algorithm