Update segments.py