Working version of inserting function parameters