Added variables and ifs