Changing the variables to arrays and changing all the code inside the function to accept the array elemenets instead of the old variables.