working blocks grouping function