add sort algorithm changes