To make CGE models realistic, we sometimes need to include inequality constraints (eg, import quotas) or non-differentiable functions (eg, income tax schedules). Both situations may be described using complementarity conditions, which state that either an equation is true or its complementary variable is at a boundary value. The paper describes a practical way to solve CGE models, which contain such conditions. The technique, which is different from complementarity algorithms commonly used elsewhere (eg GAMS), has been implemented for the next version of the GEMPACK system. In the Euler (and similar) methods used by GEMPACK, derivatives are calculated to work out the approximate effects of exogenous changes. To get more accuracy, we can divide exogenous changes into several smaller steps. We interpret this procedure as a path-following algorithm. If all equations in the model are smooth (have continuous derivatives) we can always choose sufficiently many steps to be sure that approximation errors are a smooth and decreasing function of the number of steps. At this point we can invoke extrapolation procedures which use results from, say, Euler computations of 10, 15 and 20 steps, to compute results which are as accurate as machine precision allows. The extrapolation also allows us to compute error bounds for our computation. Unfortunately, complementarity conditions are equivalent to kinked schedules; they contain points where derivatives change sharply. The lack of smoothness precludes the use of extrapolation. Without extrapolation, very many tiny Euler steps might be needed to ensure sufficient accuracy -- leading to unacceptably lengthy computations. Our paper describes one way of overcoming this problem. The key insight is that if we knew in advance which constraints would be binding in the accurate solution, the complementarity conditions could be reformulated in terms of smooth functions only, via a closure change which allows us to ignore the troublesome equa