Slides and codes for lecture 6 (nbody)