pendulum getting better, still buggy