It is well known that classical trajectories, even if they are initiated with zero point energy (ZPE) in each mode (trajectories initiated this way are commonly called quasiclassical trajectories), do not maintain ZPE in the final states. The energy of high-frequency modes will typically leak into low-frequency modes or relative translation of subsystems during the time evolution. This can lead to severe problems such as unphysical dissociation of a molecule, production of energetically disallowed reaction products, and unphysical product energy distributions. Here a new molecular dynamics method called extended Hamiltonian molecular dynamics (EHMD) is developed to improve the ZPE problem in classical molecular dynamics. In EHMD, two images of a trajectory are connected by one or more springs. The EHMD method is tested with the Henon-Heiles Hamiltonian in reduced and real units and with a Hamiltonian with quartic anharmonicity in real units, and the method is found to improve zero-point maintenance as intended.