updated with battery life meter code