implemented verlet algorithm