In order to increase the amounts of renewable energy accommodated in the system, new tools that take into account the horizon of the decision taken are necessary. Feature like the availability of new information can be included in a dynamic optimization framework and therefore help mitigate congestion in the system and have positive effects on distribution systems. This study proposes a new algorithm and shows some preliminary results for the use of Energy Storage Systems (ESS) interacting with stochastic sources of generation. The initial motivation came from the study of the adoption of renewables for electricity, and how to better harness the power of sources that are inherently oscillatory in power output. The benefits of ESS in a dynamic optimization go beyond the amount of renewable energy actually dispatched in the system. The current debate and probable adoption of electrified transportation will most likely increase the pressure on local distribution systems. However, the availability of distributed energy will also increase, in the form of energy storage, once the interface between the grid and the power sources in the vehicles is developed in a mass scale.