segment.py stuff