added extra parameter to function