Updated extractor.py to be compatible with Python version 3