pendulum example 2c works now