nickpick: there are two spaces before 'qry'. And please rename the variable to 'query' everywhere.