Completes the first step in the assignment. Merges sets and cleans up