add some functions and test functions