adding energy functions