fixed a sort function bug in list.h