random stuff with matching algorithms and such