finished coding query template files