fixed #11: implemented saving groups.