pendulum working in DP
pendulum now using initial position