Changes in distance.py, extraction.py and main.py