Added some variables and if statements