optimize ingredient order