Finished video 31
implemented the query function