gravitational n body problem (simulation and code optimisation. step by step)