Changed input from power to energy to separate the integration from the implementation.