adding group functionality to stacks