revised geometry class, hamiltonian added, test cases