Code for simple query string