added some changes to grouping script and some other small updates

@phlco -- check the diffs... some small things, but mostly adds "n groups" as a command

This was a learning experience.