working bitgrp.m!