Adding function to retrieve variables from query string