add a test program
before switch
refactoring