Reorganize sample program.