optimize minimal into variable