add a function complete version