Updated graph building with new tags check.