group by implemented fixes #1