Adding a reference with function that contains multiple and optional parameters, conditional example