Added javascript to do a better job of calculating group size.