function S = sortrowsAlt(A, column)
[N, I] = sort(A);
S = A(I(:,column),:);