refactored voltage drop calculator