added energy handling