updateing battery calculation method