added an array containing groups of array
finished groups functionality