first rewrite energy evaluation

afterward do the update