renamed display function to segment, main(): added initial codes