AppModel routine for sort on lambda