Rewrite exec_loop, make it easy to understand
Add default program parameter
Add revert back to default program mechanism