finish the test program from wiki