add function arg algorithm demo
add template support