determine.subgroups function

Determines subgroups.