INCORPORATING A LOAD SHIFTING ALGORITHM FOR OPTIMAL ENERGY STORAGE