Added groupWithA implementation