moved around the code to fix an issue where a tagged item could not be part of a tagged group (#1274)
Signed-off-by: Dan Cunningham <dan@digitaldan.com>