The first implementation of battery box.
Fix bugs
Parameters to fine-tune
No more warnings now