added powerset algorithm