redo of inputgroups logic