Finally figured out the group series

and setting variables based on their group dynamically