Move to python3
Move to python3
Renamed variables and refactored
Replace re.sub with partial