Use an anonymous function for sorting