added some logging and comments/doc lines
working version of apply alg to group (selected)