implemented powerset function