finished retrofitting extract_utils.py