Added a function to print a code segment.