question about a sort algorithm