created simple tag matching detection, query function with tag matching can still be made much better.