Removed dynamic allocation of sets and implemented deconstructor.