Pendulum: basic implementation