When writing a function in Bash you do NOT specify parameters in the function declaration. Inside the function you refer to parameters positionally, $1, $2 etc. These parameters are local to a function, hence not the command line parameters.
You pass parameters to a function by appending the call with parameters:
So if you have on the command line one parameter, and you want to pass that to you function:
Run you program with sh -x youprogram
while developing, it helps understand where the values go.