Add automated tester
Refine tester
add exit function