@miconda - I have tested the code with the changes based on your review. First part is indeed more appropriate (S*S) but i have a problem with the value of n. If only one parameter (group name) is given , n is still assigned -1. Either was S*S or SS returns -1. What do you think?