added battery calculation