cleaning up simple pendulum example