Added is_hamiltonian, haven't tested yet though