done testing energy function