added energy and relax function