Fixed the algorithm and the Union-method. It now gives the correct
result.