Script now adds battery data; bugs fixes