update sorting method