From http://stackoverflow.com/questions/12691478/unsure-how-this-union-function-on-sets-works