modify to clean-up nbody sample