What is the main function of the energy storage device