updated usort code to fix compilation errors