energy lattice seems to work correctly now