N-body simulations in C++