made global_id generic by replacing it with a call to get_group, multiplying that by the local size and then adding the local_id