Added variables for query and changed name