Updated Index
Added setup energy function