bring minimize_scalar back