script to sort people and put them in departments