. This article describes a gravitational N-body integration algorithm incorporating the following features: (1) it is time-reversible, (2) angular and linear momentum are conserved, (3) smooth switching functions are used to split potential terms into local and weak parts so that weaker long-range forces are evaluated relatively rarely and close interactions are identied, (4) close approaches between bodies are resolved accurately, using an ecient integration method, (5) the stepsize varies automatically based on an appropriate Sundman time reparameterization. Although this method is formally second order, the most intensive computations (the close approach dynamics) are executed at at higher order, thus improving the overall accuracy of the scheme. Numerical experiments indicate that the method can eectively solve few-body gravitational problems with arbitrary two-body close approaches. 1. Introduction The N-body problem of celestial mechanics is described by a Hamiltonian H (p; q..