Debugged sample_gt.py