adds auto-detection of batteries and better formatting