blog, video 31, implementing the query function

implemented the query function added 2 "$this" one "$query" and a "return"