identify groups from input
work in progress click-o-mania