bug fix in rest function
refactored union function
refactored intersection function
refactored difference function
unit tests added for union, intersection functions