How to set up a multi-parameter function?