deleted buildHamiltonian function