add Hamiltonian class