Add toString() method to Segment.java for debugging purposes