extensive comments in the pendulum example