function edited and return value given

Function edited to have arguments and parameters as well as having the
return value set to a variable and logged to the console.