Add comments on energy function.