Grouping and functions both implemented.