Lines 93-96 and the if clause on line 98 are redundant, since args[2:] will return an empty list if there are no groups to add.