energy seems to work fully!

now rewrite for general nn-hamiltonians