Add a sort function for the material list