Sort output by profit