Finished switching variables

Got the code to work with the array instead of the variables