I have set defaults for all the optional args and removed the check on the argument being set.