added groupUp function