Is `i` the index here? Shouldn't it be `sort`?