add functions and completion