updated example code to show optional params