Changed the way the variables are used