Added print_segment (for test purposes)