add function template
add tree compress test and fix bugs in run-test
modify header