How to work with a pendulum