for more information refer to hamiltonian mechanics