updates code to include state of charge, removes unused code