Alter the sort method.