An implementation of the Gale-Shapley matching algorithm