Now handles group tag - but everything is so ugly..