tidied, updated here and there, made a little simpler in preparation for more strongly group-based sending