rewriting code

Environment change, also use I and U for energy