An n-body Newtonian gravity simulator