code for server to balance populations for study groups automatically