battery_analysis about 70% done. refactored gap (addressed is_gap method duplication)