A model of human group dynamics