The first implemetation of battery box.
Optimized code.