added initial extract & distribute code: extract.py