function [V,E] = sortEigen(V,E);
[E_sorted,sorted_ind]=sort(diag(E),'descend');
V_sorted=[];
for i=1:size(E_sorted)
	V_sorted(:,i)=V(:,sorted_ind(i));
end
E=diag(E_sorted);
V=V_sorted;
clear E_sorted sorted_ind V_sorted;
