Making the Most of Distributed Energy Resources