partially generalize DataGather.py