add function and its test