a derivative implementation of xtag with a few differences in dart